package com.utils;

public class Result {
    private boolean success;
    private Object msg;
    private Object data;
//私有构造
    private Result(){
        success = true;
    }
    private Result(boolean success){this.success = success;}
    private Result(Object data){this.data = data;}
//设值
    public Result setData(Object data) {
        this.data = data;
        return this;
    }
    public Result setSuccess(boolean success) {
        this.success = success;
        return this;
    }
    public Result setMsg(Object msg) {
        this.msg = msg;
        return this;
    }

    public static Result me(){
        return new Result();
    }

    public static Result me(boolean success){
         return new Result(success);
    }

    public static Result me(Object data){
        return new Result(data).setSuccess(true);
}


    public boolean isSuccess() {
        return success;
    }
    public Object getMsg() {
        return msg;
    }
    public Object getData() {
        return data;
    }

}
